package org.dreamwork.jasmine2.web.controls.datagrid;

import org.dreamwork.util.StringUtil;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 2010-10-14
 * Time: 16:20:50
 */
public enum GroupSummary {
    None, Sum, Count;

    public static GroupSummary parse (String text) {
        if (StringUtil.isEmpty (text)) return None;
        for (GroupSummary gs : values ()) {
            if (gs.toString ().equalsIgnoreCase (text)) return gs;
        }
        throw new IllegalArgumentException ("Unknown summary: " + text);
    }
}